home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / C and C++ / System / DinkClass / DC TextEdit / DTEditApp.c < prev    next >
Text File  |  1992-10-11  |  1KB  |  71 lines

  1. /*
  2.     File:        DTEditApp.c
  3.  
  4.     Written by:    Mark Gross
  5.  
  6.     Copyright:    © 1992 by Applied Technical Software, all rights reserved.
  7.     Use at your own risk.
  8.  
  9. */
  10.  
  11. //This is the class deffinition of the DScribbleApplication
  12.  
  13. #include "DTEditApp.h"
  14. #include "DTEditDoc.h"
  15.  
  16.  
  17.  
  18. DTEditApp::DTEditApp(void)
  19. {
  20.     //Stub
  21. }
  22.  
  23.  
  24. DTEditApp::~DTEditApp()
  25. {
  26.     //Stub
  27. }
  28.  
  29.  
  30. DDocument* DTEditApp::MakeDDoc(Boolean OpenFromFile)
  31. {
  32.     DTEditDoc *New;
  33.     
  34.     New = new DTEditDoc;
  35.  
  36.             // if OpenFromFile == FALSE then it will 
  37.             // not read from any file
  38.     if(New->Init(OpenFromFile)) 
  39.     {
  40.         if ( fTarget = New->MakeWindow(HasColorQD()) )
  41.             ((DWindow *) fTarget)->SetWindowTitle();// everything went ok, so set the title
  42.                 // I'm having the App tell 
  43.                 // the doc to make the window because I don't 
  44.                 // like haveing one init function do too much stuff.  
  45.                 // Its a reliability thing. BTW FALSE is for no collorQD
  46.         else
  47.             fTarget = New; // window not created
  48.     }
  49.     else
  50.     {
  51.         fTarget = this;
  52.         SelectWindow( FrontWindow());
  53.     }
  54.     return New;
  55. }// end of MakeDDoc method
  56.  
  57.  
  58. void DTEditApp::SetUpMenues(void)
  59. {
  60.     MenuHandle    menu;
  61.     
  62.     menu = GetMHandle(rFileMenu);
  63.     EnableMenuItem( menu, iOpen, TRUE);
  64.     
  65.     inherited::SetUpMenues( );
  66.     
  67. }// end of SetUpMenus method
  68.  
  69.  
  70.  
  71.